package com.zdkj.subway.st.controller;

import com.zdkj.common.core.util.R;
import com.zdkj.common.log.annotation.SysLog;
import com.zdkj.subway.st.service.SwStTicketHandService;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/swtktickethand")
@Api(value = "swtktickethand", tags = "车票回收")
public class SwTkTicketHandController {
    private final SwStTicketHandService swStTicketHandService;

    @PutMapping("/inputDetailSubmit")
    @SysLog("加入车票入库")
    public R inputDetailSubmit(@Valid @RequestBody List<Integer> ids) {
        return R.ok(swStTicketHandService.inputDetailSubmitBatch(ids));
    }

    @PutMapping("/inputDetailSubmitNew")
    @SysLog("加入车票入库_NEW")
    public R inputDetailSubmitNew(@Valid @RequestBody List<Integer> ids) {
        return R.ok(swStTicketHandService.inputDetailSubmitNew(ids));
    }

    @PutMapping("/outputDetailSubmit")
    @SysLog("加入车票出库")
    public R outputDetailSubmit(@Valid @RequestBody List<Integer> ids) {
        return R.ok(swStTicketHandService.outputDetailSubmitBatch(ids));
    }
}
